﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace InvestmentIntelligence.DbModel.Models
{
    public class UsedSecurity 
    {
        public int Id { get; set; }

        [MaxLength(20)]
        public string Isin { get; set; }

        [MaxLength(20)]
        public string Ric { get; set; }

        [MaxLength(20)]
        public string Mic { get; set; }

        [MaxLength(20)]
        public string Sedol { get; set; }

        [MaxLength(20)]
        public string CustomIdentificator { get; set; }

        public string Name { get; set; }
        public string LongName { get; set; }
        public Nullable<int> ClassId { get; set; }
        public Nullable<int> CurrencyId { get; set; }
        public Nullable<int> EconomicSectorId { get; set; }
        public int CountryId { get; set; }
        public Nullable<int> ParentId { get; set; }

        [MaxLength(20)]
        public string ParentIdentify { get; set; }

        [MaxLength(20)]
        public string ParentIdentifyType { get; set; }
        public Nullable<short> Type { get; set; }

        [ForeignKey("CountryId")]
        public virtual Country Country { get; set; }

        [ForeignKey("CurrencyId")]
        public virtual Currency Currency { get; set; }

        [ForeignKey("EconomicSectorId")]
        public virtual EconomicSector EconomicSector { get; set; }

        [ForeignKey("ClassId")]
        public virtual SecurityClass SecurityClass { get; set; }
    }
}
